<extend name="Public/user"/>
<block name="link">
	<title>我要下单</title>
	<link href="/static/lida/css/tran_style.css" rel="stylesheet" type="text/css" />
	<link href="__CSS__/bootstrap.min.css" rel="stylesheet"/>
	<script src="__JS__/jquery.js"></script>
	<script src="__JS__/bootstrap.js"></script>
	<link href="__CSS__/ksfh-style.css" rel="stylesheet"/>
	<link rel="stylesheet" type="text/css" href="__CSS__/common.css">
</block>
<block name="user-right">
	<!--main_right-->
	<style>
		.num{margin-left: 3px ;margin-right: 3px;color: #AB263C;}
		.current{color: #AB263C;}
	</style>
	<div class="main_r f_fr">
		<div class="user_kx">
			<h3 class="user_kx_title">
				{:lang('order_info')}
			</h3>
				<table class="table table-striped table-bordered" id='yubao-adds' style="border:none;">
					<tbody>
					<tr>
						<td  class="w90">{:lang('order_num')}：</td>
						<td>{$ddinfo['sn']? $ddinfo['sn']:''}</td>
						<td>{:lang('add_time')}：</td>
						<td>{$ddinfo.addtime|date="Y-m-d",###}</td>
					</tr>
					<tr>
						<td>{:lang('shipping_method')}：</td>
						<td> <lt name='ddinfo.id' value='1345'>
										{$ddinfo.deliveryid|get_delivery_name}
									<else/>
									{$ddinfo.transport_id|get_transport}({$ddinfo.transport_line_id|get_transport_line})
									</lt></td>
						<td>{:lang('declared_value')}：</td>
						<td>{$ddinfo.shenbao}<eq name='ddinfo.fuwu_baojia' value='0'>日元【未申请保价服务】</eq></td>
					</tr>
					<tr>
						<td>{:lang('delivery_info')}：</td>
						<td colspan="3">{$ddinfo.consignee}({$ddinfo.tel}) &nbsp;({$ddinfo.zipcode}){$ddinfo.area_info}{$ddinfo.address}</td>
					</tr>
					<tr>
						<td>增值服务：</td>
						<td colspan="3">
							<eq name='ddinfo.fuwu_baojia' value='1'>保价|</eq>
							<eq name='ddinfo.fuwu_jiagu' value='1'>超级加固|</eq>
							<eq name='ddinfo.fuwu_jiagu' value='0'>简单加固|</eq>
							<eq name='ddinfo.fuwu_jiaji' value='1'>加急</eq></td>
					</tr>
					<tr>
						<td>费用总计：</td>
						<td colspan="3">{$ddinfo['freight']}日元
						</td>
					</tr>
					<tr>
						<td>运费详情：</td>
						<td colspan="3">{$ddinfo['freight_info']? $ddinfo['freight_info']:''}
						</td>
					</tr>
					<tr>
						<td>订单备注：</td>
						<td colspan="3">{$ddinfo['remark']? $ddinfo['remark']:''}</td>
					</tr>
					</tbody>
				</table>

		</div>
		<div class="user_kx">
			<h3 class="user_kx_title">
				打包列表
			</h3>
			<table class="table table-striped table-bordered" id='yubao-adds' style="border:none;">
				<tbody>
				<tr>

					<th>{:lang('guoji_delivery_num')}</th>
					<th>转国内运单号</th>
					<th>{:lang('boxSize')}</th>
					<th width="80">{:lang('allWeight')}</th>
					<th>{:lang('remark')}</th>
					<th width="80"><!--{:lang('tjCost')}--></th>
					<th width="80"><!--{:lang('freight')}（{:config('MAIN_COIN')}）--></th>
				</tr>
				<if condition="$bglist">
					<volist name="bglist" id="v">
						<tr>

							<td>{$v['bgsn']? $v['bgsn']:''}</td>
							<td>{$v['in_express']? $v['in_express']:'暂无'}</td>
							<td>{$v['size']? $v['size']:''}</td>
							<td>{$v['weight']? $v['weight']:''}kg</td>
							<td>{$v['remark']? $v['remark']:''} </td>
							<td><!--{$v['volume']}--></td>
							<td align="right"><b style="color:red;" class="freight"><!--{$v['freight']? $v['freight']:''}--></b></td>
						</tr>
					</volist>
					<else />
					<tr><td colspan="8">{:lang('no_infos')}</td></tr>
				</if>
				</tbody>
			</table>

		</div>
		<div class="user_kx">
			<h3 class="user_kx_title">
				{:lang('forecast_list')}
			</h3>
			<table class="table table-striped table-bordered" id='yubao-adds' style="border:none;">
				<tbody>
				<tr>
					<th width="80">{:lang('ex_num')}</th>
					<th width="100">{:lang('baoguo_name')}</th>
					<th>{:lang('jiazhi')}</th>
<!--
					<th width="80">{:lang('baoguo_leixing')}</th>
-->
					<th>{:lang('remark')}</th>
					<th>{:lang('status')}</th>
					<th>{:lang('operation')}</th>
				</tr>
				<volist name="yblist" id="v">
					<tr>
						<td>{$v['kuaidi_sn']? $v['kuaidi_sn']:''}</td>
						<td>{$v['baoguo_name']? $v['baoguo_name']:''}</td>
						<td>{$v['jiazhi']? $v['jiazhi']:''}</td>
<!--
						<td><eq name="v.baoguo_type" value="0">{:lang('common_goods')}</eq><eq name="v.baoguo_type" value="1">{:lang('sensitive_goods')}</eq></td>
-->
						<td>{$v['remark']? $v['remark']:''}</td>
						<td>{$v.status|getyubaostatus}</td>
						<td><eq name="ddinfo.status" value="1"><a href="javascript:;" class="delete" did="{$v.id}" title="{:lang('remove_from_order')}"><i class="icon-trash"></i></a> <a href="###" title="编辑" class="bianji" yid="{$v.id}"><i class="icon-edit"></i></a></eq></td>
					</tr>
				</volist>
				</tbody>
			</table>

		</div>
		
		<div class="user_kx">
			<b style="color:red;">{:lang('order_status')}：{$ddinfo.status|getyundanstatus}</b> &nbsp; &nbsp;
			<!--  <a href="{:url('User/dayindingdan','id='.$ddinfo['id'])}" target="_blank">{:lang('print_order')}</a>&nbsp;&nbsp;
            --><eq name="ddinfo.payed" value="2">
			<a href="{:url('User/paydingdan','id='.$ddinfo['id'])}" style="display:inline-block;background: red;color: #fff;padding: 2px 2px;">{:lang('pay_yukuan')}</a>
		</eq>
			<eq name="ddinfo.status" value="3">
				<div class="blank"></div>
				<div class=" ybcartinbtn btn btn-danger" style="margin-left:45%;width:82px;">
					<a href="{:url('User/paydingdan','id='.$ddinfo['id'])}" class="btnqd tijiaodingdan" style="color:#fff;"id="quchongzhi"  style="width:100%;">{:lang('go_payment')}</a>
				</div>
			</eq>
			<eq name="ddinfo.status" value="5">
				<div class="blank"></div>
				<div style="width:150px;line-height: 20px;margin: 0 auto;">
					<a href="javascript:shouhuo({$ddinfo.id});" class=" ybcartinbtn btn btn-danger" style="color:#fff;" id="quchongzhi"  >{:lang('confirm_receipt')}</a>
				</div>
			</eq>
			<div class="clear"></div>
		</div>
	</div>
</block>
<block name="javascript">
	<script type="text/javascript">
		function shouhuo(id){
			$.post("{:url('shouhuo')}",{'id':id},function(data){
				if (data.status) {
					$.thinkbox.success(data.info);
					setTimeout(jumpurl(data.url),1000);
				}else{
					$.thinkbox.error(data.info);
				};
			})
		}
		$(function(){
			$('.bianji').click(function(){
				var id=$(this).attr('yid');
				var loading=$.thinkbox.loading('加载中');

				$.post("{:url('User/getyubaoinfo')}",{'id':id},function(data){

					$('input[name="kuaidi_sn"]').val(data.kuaidi_sn);
					$('input[name="baoguo_name"]').val(data.baoguo_name);
					$('input[name="shenbao"]').val(data.shenbao);
					$('input[name="jiazhi"]').val(data.jiazhi);
					$('input[name="id"]').val(data.id);
					$('input[name="remark"]').val(data.remark);
					$('#baoguo_type').find('option[value='+data.baoguo_type+']').attr('selected',true);
					$('#baoguo_type').find('option').not('option[value='+data.baoguo_type+']').attr('selected',false);
					$('#is_chaibao').find('option[value='+data.is_chaibao+']').attr('selected',true);
					$('#is_chaibao').find('option').not('option[value='+data.is_chaibao+']').attr('selected',false);
					$.thinkbox('#ybedit',{'title':'编辑预报信息','dataEle':this,'drag':true});
					loading.hide();
				})

			})
			$('form#edityubao').submit(function(){
				var self = $(this);
				$.post(self.attr("action"), self.serialize(), success, "json");
				return false;
				function success(data){
					if (data.status) {
						$.thinkbox.success(data.info);
						setTimeout('location.reload()',1100);
					}else{
						$.thinkbox.error(data.info);
					};
				}
			})
			$('#printbtn').click(function(){
				$("#printarea").printArea();
			})
			$('.delete').click(function(){
				var id=$(this).attr('did');
				$.thinkbox.confirm('{:lang("confirm_yichuorder")}',{
					'dataEle' : this,
					'afterHide':function(data){
						if (data==true) {
							$.post("{:url('User/dingdanyichu')}",{'id':id},function(result){
								if (result.status) {
									$.thinkbox.success(result.info);
									setTimeout('location.reload()',1000);
								}else{
									$.thinkbox.error(result.info);
								};
							})
						};
					}
				});
			});
		})
	</script>
</block>